package com.entity;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * AccpRole entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ACCP_ROLE", schema = "ACCP")
public class AccpRole implements java.io.Serializable {

	// Fields

	private Integer rid;
	private String rname;
	private Set<AccpStudent> accpStudents = new HashSet<AccpStudent>(0);

	// Constructors

	/** default constructor */
	public AccpRole() {
	}

	/** minimal constructor */
	public AccpRole(Integer rid) {
		this.rid = rid;
	}

	/** full constructor */
	public AccpRole(Integer rid, String rname, Set<AccpStudent> accpStudents) {
		this.rid = rid;
		this.rname = rname;
		this.accpStudents = accpStudents;
	}

	// Property accessors
	@Id
	@Column(name = "RID", unique = true, nullable = false, precision = 8, scale = 0)
	public Integer getRid() {
		return this.rid;
	}

	public void setRid(Integer rid) {
		this.rid = rid;
	}

	@Column(name = "RNAME", length = 20)
	public String getRname() {
		return this.rname;
	}

	public void setRname(String rname) {
		this.rname = rname;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "accpRole")
	public Set<AccpStudent> getAccpStudents() {
		return this.accpStudents;
	}

	public void setAccpStudents(Set<AccpStudent> accpStudents) {
		this.accpStudents = accpStudents;
	}

}